<?php

namespace app\apisell\controller\admin;

use app\apisell\service\poster\PosterService;
use app\common\controller\BaseController;
use app\common\utils\Res;

class Poster extends BaseController
{
    //推广海报列表
    public function getPopuList()
    {
        $param = $this->request->param();
        $uid = $this->request->uid;
//        $is_popu = $this->request->isPopu;
        $result = PosterService::getPopuList($param,$uid);
        return Res::ok($result);
    }

    //推广海报列表
    public function getGroupList()
    {
        $param = $this->request->param();
        $uid = $this->request->uid;
        $result = PosterService::getGroupList($param,$uid);
        return Res::ok($result);
    }
    
    //制作海报
    public function createdPoster()
    {
        $param = $this->request->param();
        unset($param['id']);
        $param['add_id'] =  $this->request->uid;
        $result = PosterService::createdPoster($param);
        return Res::ok($result);
    }
    
    //通过id获取海报信息
    public function getPosterInfo()
    {
        $param = $this->request->param();
        $result = PosterService::getPosterInfo($param);
        return Res::ok($result);
    }
    
    //编辑海报
    public function editePoster()
    {
        $param = $this->request->param();
        $param['add_id'] =  $this->request->popuId;
        $result = PosterService::editePoster($param);
        return Res::ok($result);
    }
    
    
    //删除海报
    public function delPoster()
    {
        $param = $this->request->param();
        $param['del_id'] =  $this->request->uid;
        $result = PosterService::delPoster($param);
        return Res::ok($result);
    }
    
}